<script setup>
import { onMounted } from 'vue';
import esriConfig from '@arcgis/core/config';
import Map from '@arcgis/core/Map';
import MapView from '@arcgis/core/views/MapView';

onMounted(() => {
  alert('000')
  // 设置 ArcGIS API 的资源路径
  esriConfig.assetsPath = '/node_modules/@arcgis/core/assets';

  // 创建地图
  const map = new Map({
    basemap: 'streets-vector'
  });

  // 创建视图
  const view = new MapView({
    container: 'viewDiv',
    map: map,
    center: [-118.805, 34.027], // 初始地图中心坐标
    zoom: 13 // 初始地图缩放级别
  });
});
</script>

<template>
    <div id="viewDiv" style="width: 100%; height: 100vh;"></div>
</template>


<style>
#viewDiv {
  padding: 0;
  margin: 0;
  height: 100vh;
  width: 100vw;
}
</style>